﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIAKADCORE.Models
{
    /// <summary>
    /// Kelas Periode [dbo].[periode]
    /// </summary>
    public class Periode
    {
        #region Constants
        /// <summary>
        /// Konstanta panjang id dari primary key
        /// </summary>
        public const int IdLength = 5;
        /// <summary>
        /// Konstanta prefix dari primary key
        /// </summary>
        public const string IdPrefix = "PRD";
        /// <summary>
        /// Konstanta nama tabel pada database
        /// </summary>
        public const string TabelName = "[dbo].[periode]";
        /// <summary>
        /// Konstanta nama kolom idPeriode pada tabel
        /// </summary>
        public const string ColumnNameIdPeriode = "[id_periode]";
        /// <summary>
        /// Konstanta nama kolom namaPeriode pada tabel
        /// </summary>
        public const string ColumnNameNamaPeriode = "[nama_periode]"; 
        #endregion

        #region Fields
        /// <summary>
        /// [id_periode] CHAR(5) PRIMARY KEY
        /// </summary>
        private string idPeriode;
        /// <summary>
        /// [nama_periode] CHAR(5) NOT NULL
        /// </summary>
        private string namaPeriode; 
        #endregion

        #region Properties
        /// <summary>
        /// [id_periode] CHAR(5) PRIMARY KEY
        /// </summary>
        public string IdPeriode
        {
            get { return this.idPeriode; }
            set { this.idPeriode = value; }
        }

        /// <summary>
        /// [nama_periode] CHAR(5) NOT NULL
        /// </summary>
        public string NamaPeriode
        {
            get { return this.namaPeriode; }
            set { this.namaPeriode = value; }
        } 
        #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Periode()
        {

        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="idPeriode">[id_periode] CHAR(5) PRIMARY KEY</param>
        /// <param name="namaPeriode">[nama_periode] CHAR(5) NOT NULL</param>
        public Periode(string idPeriode, string namaPeriode)
        {
            this.idPeriode = idPeriode;
            this.namaPeriode = namaPeriode;
        } 
        #endregion

        public override string ToString()
        {
            return string.Format("ID_PERIODE: {0} | NAMA_PERIODE: {1}", this.idPeriode, this.namaPeriode);
        }
    }
}
